package jssia.config.yaml;


public final class DatabaseConfiguration {

    public String src_db_name;
    public String server_db_name;
    public String host;
    public String user;
    public String pass;

    public DatabaseConfiguration() {
    }

    public DatabaseConfiguration(DatabaseConfiguration config) {
        src_db_name = config.src_db_name;
        server_db_name = config.server_db_name;
        host = config.host;
        user = config.user;
        pass = config.pass;
    }

    @Override
    public int hashCode() {
        return src_db_name.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (!(obj instanceof DatabaseConfiguration))
            return false;
        DatabaseConfiguration other = (DatabaseConfiguration) obj;
        if (src_db_name == null) {
            if (other.src_db_name != null)
                return false;
        } else if (!src_db_name.equals(other.src_db_name))
            return false;
        return true;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("DatabaseConfiguration [src_db_name=")
                .append(src_db_name).append(", server_db_name=")
                .append(server_db_name).append(", host=").append(host)
                .append(", user=").append(user).append(", pass=").append(pass)
                .append("]");
        return builder.toString();
    }
}
